package org.hfy.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * 报价单物料明细实体类
 * 
 * @author hfy
 * @version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("quotation_items")
public class QuotationItem extends BaseEntity {

    /**
     * 报价单ID
     */
    @NotNull(message = "报价单ID不能为空")
    @TableField("quotation_id")
    private Long quotationId;

    /**
     * 序号
     */
    @NotNull(message = "序号不能为空")
    @TableField("item_no")
    private Integer itemNo;

    /**
     * 产品名称
     */
    @NotBlank(message = "产品名称不能为空")
    @Size(max = 100, message = "产品名称长度不能超过100个字符")
    @TableField("product_name")
    private String productName;

    /**
     * 物料编码
     */
    @Size(max = 50, message = "物料编码长度不能超过50个字符")
    @TableField("material_code")
    private String materialCode;

    /**
     * 采购订单号
     */
    @Size(max = 50, message = "采购订单号长度不能超过50个字符")
    @TableField("purchase_order_no")
    private String purchaseOrderNo;

    /**
     * 层数
     */
    @NotBlank(message = "层数不能为空")
    @Size(max = 10, message = "层数长度不能超过10个字符")
    @TableField("layers")
    private String layers;

    /**
     * 板厚(mm)
     */
    @NotBlank(message = "板厚不能为空")
    @Size(max = 10, message = "板厚长度不能超过10个字符")
    @TableField("thickness")
    private String thickness;

    /**
     * 表面处理
     */
    @NotBlank(message = "表面处理不能为空")
    @Size(max = 20, message = "表面处理长度不能超过20个字符")
    @TableField("surface_treatment")
    private String surfaceTreatment;

    /**
     * 阻焊
     */
    @NotBlank(message = "阻焊不能为空")
    @Size(max = 20, message = "阻焊长度不能超过20个字符")
    @TableField("solder_mask")
    private String solderMask;

    /**
     * 字符
     */
    @Size(max = 10, message = "字符长度不能超过10个字符")
    @TableField("`character`")
    private String character;

    /**
     * 板材
     */
    @Size(max = 50, message = "板材长度不能超过50个字符")
    @TableField("board_material")
    private String boardMaterial;

    /**
     * 交货尺寸(mm)
     */
    @Size(max = 50, message = "交货尺寸长度不能超过50个字符")
    @TableField("delivery_size")
    private String deliverySize;

    /**
     * 拼版
     */
    @Size(max = 50, message = "拼版长度不能超过50个字符")
    @TableField("panelization")
    private String panelization;

    /**
     * 内铜
     */
    @Size(max = 10, message = "内铜长度不能超过10个字符")
    @TableField("inner_copper")
    private String innerCopper;

    /**
     * 外铜
     */
    @Size(max = 10, message = "外铜长度不能超过10个字符")
    @TableField("outer_copper")
    private String outerCopper;

    /**
     * 过孔工艺
     */
    @Size(max = 20, message = "过孔工艺长度不能超过20个字符")
    @TableField("via_process")
    private String viaProcess;

    /**
     * 测试
     */
    @Size(max = 20, message = "测试长度不能超过20个字符")
    @TableField("testing")
    private String testing;

    /**
     * 测试架费
     */
    @TableField("testing_fee")
    private BigDecimal testingFee;

    /**
     * 是否加急
     */
    @TableField("is_urgent")
    private Boolean isUrgent;

    /**
     * 数量
     */
    @NotNull(message = "数量不能为空")
    @TableField("quantity")
    private Integer quantity;

    /**
     * 单价
     */
    @TableField("unit_price")
    private BigDecimal unitPrice;

    /**
     * 样板费
     */
    @TableField("sample_fee")
    private BigDecimal sampleFee;

    /**
     * 工程费
     */
    @TableField("engineering_fee")
    private BigDecimal engineeringFee;

    /**
     * 加急费
     */
    @TableField("urgent_fee")
    private BigDecimal urgentFee;

    /**
     * 阻抗费
     */
    @TableField("impedance_fee")
    private BigDecimal impedanceFee;

    /**
     * 运费
     */
    @TableField("shipping_fee")
    private BigDecimal shippingFee;

    /**
     * 税金
     */
    @TableField("tax_amount")
    private BigDecimal taxAmount;

    /**
     * 自定义字段(JSON格式)
     */
    @TableField("custom_fields")
    private String customFields;

    /**
     * 合计金额
     */
    @TableField("total_amount")
    private BigDecimal totalAmount;

    /**
     * 出货日期
     */
    @TableField("delivery_date")
    private LocalDate deliveryDate;

    /**
     * 备注
     */
    @TableField("item_remark")
    private String itemRemark;

    /**
     * 是否含税
     */
    @TableField("is_tax_included")
    private Boolean isTaxIncluded;

    /**
     * 付款方式
     */
    @Size(max = 50, message = "付款方式长度不能超过50个字符")
    @TableField("payment_method")
    private String paymentMethod;

    /**
     * 其它费用
     */
    @TableField("other_fee")
    private BigDecimal otherFee;

    /**
     * 计算信息 (非数据库字段)
     */
    @TableField(exist = false)
    private QuotationCalculation calculation;

    /**
     * 成本明细 (非数据库字段)
     */
    @TableField(exist = false)
    private QuotationCost costs;

    /**
     * 客户代码 (非数据库字段，用于关联查询时临时存储)
     */
    @TableField(exist = false)
    private String customerCode;

    /**
     * 客户名称 (非数据库字段，用于关联查询时临时存储)
     */
    @TableField(exist = false)
    private String customerName;
} 